package protocol.registration;

import java.io.DataOutputStream;
import java.io.IOException;

public class RegistrationRequest {

	private final String TYPE = "Printer";
	private int m_port;
	private String m_ip;
	private int m_zona;
	private int m_ID;
	
	public RegistrationRequest(int ID, int port, String ip, int zona)
	{
		m_ID = ID;
		m_port = port;
		m_ip = ip;
		m_zona = zona;
	}
	
	//OUTPUT : Type Port Ip 
	public DataOutputStream write(DataOutputStream dos) throws IOException
	{
		
		dos.writeInt(m_ID);
		dos.writeUTF(TYPE);
		dos.writeInt(m_port);
		dos.writeUTF(m_ip);
		dos.writeInt(m_zona);
		
		return dos;
	}
}
